//
//  ChangeLogoRequest.m
//  NPS
//
//  Created by jadd on 15/10/21.
//  Copyright © 2015年 jadd. All rights reserved.
//

#import "ChangeLogoRequest.h"

@interface ChangeLogoRequest()

@property (nonatomic) NSString *userId;

@end


@implementation ChangeLogoRequest

-(instancetype)initWithUserId:(NSString*)userId
{
    self = [super init];
    if (self) {
        self.userId = userId;
        
    }
    return self;
    
}


- (NSString *)getRequestURL {
    NSString *jsonString= [Config generateStringToJson:[self getRequestParams]];
    NSString *s = [Config GTMEncodeTest:jsonString];
    NSString *accesskey = [Config getAccess_key];
    NSString *appendString = [[NSString alloc] initWithFormat:@"%@%@",s, accesskey];
    NSString *v = [Config md5:appendString];
    
    NSString * baseUrl = [super getRequestURL];
    NSString *url = [NSString stringWithFormat:@"%@%@/?s=%@&v=%@",baseUrl, API_Change_Logo,s,v];
    return url;
}

- (RequestMethodType)getRequestMethod {
    return PostMethod;
}

- (id)getRequestParams {
    NSMutableDictionary * paramDict = [super getRequestParams];
        if (self.userId) {
        [paramDict setObject:self.userId forKeyedSubscript:@"user_id"];
    }
    return paramDict;
}

@end
